<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="__JS__/qtip/js/jquery.qtip.min.js"></script>
<link href="__JS__/qtip/css/jquery.qtip.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="__JS__/validfrom/css/style.css" type="text/css" media="all" />
<script type="text/javascript" src="__JS__/NiceForms/niceforms.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="__JS__/NiceForms/niceforms-default.css" />
<link href="__CSS__/main.css" rel="stylesheet" type="text/css" />
<literal>
<script>
$(document).ready(function(){

	
	
	$("#submitImage").bind("click",function(){
		$('#orderForm').ajaxSubmit(options); 
	});
	
	var options={
			 beforeSubmit:  showRequest,  
			 success:       showResponse  
	};
	function showRequest(formData, jqForm, options) {  
		
		if($("#U_RNAME").val()==""){
			$("#Validform_checktip_U_RNAME").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>请输入姓名</a>");
			return false;
		}else{
			$("#Validform_checktip_U_RNAME").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
		}
		if($("#U_EMAIL").val()==""){
			$("#Validform_checktip_U_EMAIL").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>请输入邮箱</a>");
			return false;
		}else{
			var _re=/^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
			
			if(!_re.test($("#U_EMAIL").val())){
				$("#Validform_checktip_U_EMAIL").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>邮箱格式错误</a>");
				return false;
			}else{
				$("#Validform_checktip_U_EMAIL").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
			}
		}
		if($("#U_MOBILE").val()==""){
			$("#Validform_checktip_U_MOBILE").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>请输入手机</a>");
			return false;
		}else{
			var _re=/^\d{11}$/;
			if(!_re.test($("#U_MOBILE").val())){
				$("#Validform_checktip_U_MOBILE").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>手机格式错误</a>");
				return false;
			}else{
				$("#Validform_checktip_U_MOBILE").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
			}
		}
		if($("#AR_L1").val()==""){
			$("#Validform_checktip_AR_L").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>请选择省市</a>");
			return false;
		}
		if($("#AR_L2").val()==""){
			$("#Validform_checktip_AR_L").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>请选择市辖区</a>");
			return false;
		}
		if($("#AR_L3").val()==""){
			$("#Validform_checktip_AR_L").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>请选择区县</a>");
			return false;
		}
		$("#Validform_checktip_AR_L").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
		 return true;
	}
	
	function showResponse(rs, statusText, xhr, $form)  { 
		
		
		if(rs=="E"){
			$("#Validform_checktip_U_EMAIL").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>邮箱重复</a>");
			return false;
		}else{
			$("#Validform_checktip_U_EMAIL").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
		}
		if(rs=="M"){
			$("#Validform_checktip_U_MOBILE").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>手机重复</a>");
			return false;
		}else{
			$("#Validform_checktip_U_MOBILE").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
		}
		
		if(rs=='n'){
			userTip('submitImage','修改信息失败！');
			/*info="修改信息失败！";
			type='2';
			url="?g=Home&m=Member&a=uinfo";
			*/
			return false;
		}
		
		if(rs=='SRVTEAM'){
			info="修改信息成功！";
			type='1';
			url="?g=Home&m=Order&a=srvlist";
		}
		if(rs=='CR'){
			info="修改信息成功！";
			type='1';
			url="?g=Home&m=Order&a=olist";
		}
		window.location.href="?g=Home&m=Index&a=info&type="+type+"&info="+encodeURI(info)+"&url="+encodeURIComponent(url);
		
	} 
	//得到地区
	$("#AR_L1").bind('change',function(){
		if($(this).val()==''){
			return false;
		}
		$("#AR_L2").empty();
		$("#AR_L2").append('<option value="">--市辖区--</option>');
		getArea('AR_L1',$(this).val(),'AR_L2');
	});
	$("#AR_L2").bind('change',function(){
		if($(this).val()==''){
			return false;
		}
		$('#AR_L3').empty();
		$('#AR_L3').append('<option value="">--区县--</option>');
		getArea('AR_L1|AR_L2',$("#AR_L1").val()+"|"+$(this).val(),'AR_L3');
	});
	
});
function userTip(sob,ct){
	 // 阴影+圆角
     $("#"+sob).qtip({
   	 	position: {
            my: 'bottom left',
            at: 'top center'
       },
       style: {
         classes: 'ui-tooltip-light ui-tooltip-shadow ui-tooltip-rounded'
       },
       show: {
			event: 'click', // Don't specify a show event...
			ready: true // ... but show the tooltip when ready
		},
       content: {
    	   text:ct,
    	   title:{
    	    	  text:"提示信息", 
    	    	  button:"关闭"
    	       }
       },
       hide:false
       
     });
}
function getArea(stName,st,fl){
	$.ajax({
		   type: "POST",
		   url: "?g=Home&m=Index&a=getArea",
		   data: "stName="+stName+"&st="+st+"&fl="+fl+'&rd'+Math.random(),
		   dataType:'json',
		   success: function(msg){
			 if(msg.sucess=='y'){
				var f=msg.fl;
				var data=msg.data;
				var _html=[];
				var k;
				for (k in data){
					_html.push('<option value="'+data[k]+'">'+data[k]+'</option>');
				}
				
				$("#"+f).append(_html.join(''));
				
				for (k in data){
					_html.push('<li><a href="javascript:;">'+data[k]+'</a></li>');
				}
				$("#"+f+"_1").append(_html.join(''));
			 }
		     
		   }
	});
}

function setArea(stName,st,fl,v){
	$.ajax({
		   type: "POST",
		   url: "?g=Home&m=Index&a=getArea",
		   data: "stName="+stName+"&st="+st+"&fl="+fl+'&rd'+Math.random(),
		   dataType:'json',
		   success: function(msg){
			 if(msg.sucess=='y'){
				var f=msg.fl;
				var data=msg.data;
				var _html=[];
				var k;
				for (k in data){
					var _sel='';
					if(v==data[k]){
						_sel="selected";
					}
					_html.push('<option value="'+data[k]+'"  '+_sel+'>'+data[k]+'</option>');
				}
				
				$("#"+f).append(_html.join(''));
			 }
		     
		   }
	});
}
</script>
</literal>
<style>

.content{
	background-color:#F9F9F9;
	width:750px;
	height:440px;
	margin-left:95px;
}
</style>
<div id="container">
<div class="content" style="height:400px;margin-left: 0;">
<form action="" method="post" id="orderForm" class="niceform">
	<div style="padding-top:20px;">
		<table border=0 cellspacing=0 cellpadding=0 width="100%">
			<tr>
				
				<td colspan="3" align="left" valign="bottom">
				<div style="padding-left:20px;height:20px;color:#FF7625;font-weight:bold;font-size:15px;">修改信息
				
				</div>
				
				</td>
			</tr>
			<tr>
			<td colspan="3" valign="top">
				<div style="height:2px;width:150px;background-color:#FF7625;margin-left:20px;"></div>
				</td>
			</tr>
			<tr>
				<td width="120px">
					
				</td>
				<td  align="left">
					<div style="">
					<table border="0" >
		                <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:80px;line-height:30px;"><span class="inputYes">*</span>姓名</td>
		                    <td style=""><input type="text" id="U_RNAME" name="data[U_RNAME]" class="inputxt" value="{$userInfo.U_RNAME}" datatype="*" nullmsg="请输入姓名！"  /></td>
		                    <td><div class="Validform_checktip" id="Validform_checktip_U_RNAME">请输入姓名</div></td>
		                </tr>
		                 <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:80px;line-height:30px;"><span class="inputYes">*</span>邮箱</td>
		                    <td style=""><input type="text" id="U_EMAIL" name="data[U_EMAIL]" class="inputxt" value="{$userInfo.U_EMAIL}" datatype="*" nullmsg="请输入邮箱！"  />
		                     <input type="hidden" id="OLD_U_EMAIL" name="data[OLD_U_EMAIL]" value="{$userInfo.U_EMAIL}"  />
		                    </td>
		                    <td><div class="Validform_checktip" id="Validform_checktip_U_EMAIL">请输入邮箱</div></td>
		                </tr>
		                
		                 <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:80px;line-height:30px;"><span class="inputYes">*</span>手机</td>
		                    <td style="width:;"><input type="text" onkeyup="this.value=this.value.replace(/\D/g,'');" id="U_MOBILE" name="data[U_MOBILE]" value="{$userInfo.U_MOBILE}" class="inputxt" datatype="*" nullmsg="请输入手机！"  />
		                     <input type="hidden" id="OLD_U_MOBILE" name="data[OLD_U_MOBILE]" value="{$userInfo.U_MOBILE}"  />
		                    </td>
		                    <td><div class="Validform_checktip" id="Validform_checktip_U_MOBILE">请输入手机</div></td>
		                </tr>
		                 <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:80px;line-height:30px;">固定电话</td>
		                    <td style="width:;"><input type="text" id="U_PHONE" name="data[U_PHONE]" value="{$userInfo.U_PHONE}" class="inputxt" nullmsg="请输入固定电话！"  /></td>
		                    <td><div class="Validform_checktip">请输入固定电话</div></td>
		                </tr>
		                 <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:80px;line-height:30px;"><span class="inputYes">*</span>地址</td>
		                    <td style="width:;">
		                    <table border="0" cellpacing="0" cellpadding="0">
									<tr>
										<td width="30%">
											<select size=1 id="AR_L1" name="data[AR_L1]" datatype="*" style="width:">
												<option value="">--省市--</option>
												<volist name="AR_L1" id="vo">
												<option value="{$vo}" <if condition="$userInfo.AR_L1 eq $vo">selected</if>>{$vo}</option>
												</volist>
											</select>
										</td>
									
										<td width="30%">
											<select size=1  datatype="*"  id="AR_L2" name="data[AR_L2]" style="width:">
												<option value="">--市辖区--</option>
											</select>
										</td>
										</tr><tr>
										<td width="30%" colspan="2">
											<select size=1 datatype="*" id="AR_L3" name="data[AR_L3]" style="width:100px;">
												<option value="">--区县--</option>
											</select>
										</td>
									</tr>
								</table>
		                    </td>
		                    <td><div class="Validform_checktip" id="Validform_checktip_AR_L" style="line-height:30px;">请输入地址</div></td>
		                </tr>
		                 <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:80px;line-height:30px;">详细地址</td>
		                    <td style="width:;"><input type="text" id="U_ADDRESS" name="data[U_ADDRESS]" value="{$userInfo.U_ADDRESS}" class="inputxt"   /></td>
		                    <td><div class="Validform_checktip">请输入详细地址</div></td>
		                </tr>
		                
		                <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:0px;"></td>
		                    <td style="width:205px;" valign="bottom" align="center">
		                   	<br />
		                    	<input type="hidden" name="uid" value="{$uid}">
    							<input type="hidden" name="op" value="1">
    							<div style="display:none"><input type="submit" id="sumit" name="sumit" ></div>
		                    	<img src="__PUBLIC__/images/home/bg-ok-button.png" id="submitImage" align="absmiddle" style="cursor:pointer">
		                    </td>
		                    <td></td>
		                </tr>
		                    
					
					</table>
					</div>
				</td>
			</tr>
			
		</table>
	</div>
	</form>
</div>
</div>
<if condition="$userInfo.AR_L1 neq ''">
	<literal>
	<script>
		$("#AR_L2").empty();
		$("#AR_L2").append('<option value="">--市辖区--</option>');
		setArea('AR_L1','{$userInfo.AR_L1}','AR_L2','{$userInfo.AR_L2}');
		
		$('#AR_L3').empty();
		$('#AR_L3').append('<option value="">--区县--</option>');
		setArea('AR_L1|AR_L2',"{$userInfo.AR_L1}|{$userInfo.AR_L2}",'AR_L3','{$userInfo.AR_L3}');
	</script>
	</literal>
</if>